Skip to content

S28 2903 Input Data Validation for possibly malicious content#1385

Open
RuthKirby wants to merge 30 commits intomasterfrom
S28-2903-data-validation
Open

S28 2903 Input Data Validation for possibly malicious content#1385
RuthKirby wants to merge 30 commits intomasterfrom
S28-2903-data-validation

Conversation

@RuthKirby
Copy link
Copy Markdown
Contributor

@RuthKirby RuthKirby commented Mar 24, 2026

JIRA ticket(s)

https://tools.hmcts.net/jira/browse/S28-2903
https://tools.hmcts.net/jira/browse/S28-2942

Change description

  • Adds custom Sanitizer validation annotation for Strings

QA instructions

  • Try to create and update (PUT/POST) the below with unsafe data in their string fields (e.g. <script>alert("malicious!")</script>, , <a href="https://example.com">I am bad link</a>. You should receive back a 400 status code with a response message related to "Potentially malicious content":
    • Capture Session
    • Court
    • Edit Request
    • Invite
    • User
    • VFMigration
    • Audit
    • Participant
    • (any others you can think of)
  • Regression testing that retrieving data via GET is unchanged
    Note: The one exception is the Audit Details, strings within its JSON will fail the test. Validation annotation for that field will be completed in https://tools.hmcts.net/jira/browse/S28-4842

@RuthKirby RuthKirby requested a review from a team as a code owner March 24, 2026 16:11
@RuthKirby RuthKirby changed the title S28 2903 data validation S28 2903 Input Data Validation Mar 24, 2026
Copy link
Copy Markdown
Contributor

@oliver-scott oliver-scott left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice work both!

@RuthKirby RuthKirby changed the title S28 2903 Input Data Validation S28 2903 Input Data Validation for possibly malicious content Mar 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants